using System;
using System.Collections.Generic;

using SMSSender.Entities.Utils;
using SMSSender.Entities.Models;
using SMSSender.DAL;
using SMSSender.Common;

namespace SMSSender.Biz
{
	public class CustomerRoleService
	{
		/// <summary>
		/// Saves a record to the CustomerRole table.
		/// </summary>
		public virtual void Insert(CustomerRoleInfo customerRoleInfo)
		{
			try
			{
				new CustomerRoleDAO().Insert(customerRoleInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("SMSSender.Biz.CustomerRole - Insert", ex);
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the CustomerRole table.
		/// </summary>
		public virtual void Update(CustomerRoleInfo customerRoleInfo)
		{
			try
			{
				new CustomerRoleDAO().Update(customerRoleInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("SMSSender.Biz.CustomerRole - Update", ex);
				throw;
			}

		}

		/// <summary>
		/// Delete a record from the CustomerRole table.
		/// </summary>
		public virtual void Delete(Guid? idRole)
		{
			try
			{
				new CustomerRoleDAO().Delete(idRole);
			}
			catch (Exception ex)
			{
				Logger.Error("SMSSender.Biz.CustomerRole - Delete", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects a single record from the CustomerRole table.
		/// </summary>
		public virtual CustomerRoleInfo Select(Guid? idRole)
		{
			try
			{
				return new CustomerRoleDAO().Select(idRole);
			}
			catch (Exception ex)
			{
				Logger.Error("SMSSender.Biz.CustomerRole - Select", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects all records from the CustomerRole table.
		/// </summary>
		public List<CustomerRoleInfo> SelectAll()
		{
			try
			{
				return new CustomerRoleDAO().SelectAll();
			}
			catch (Exception ex)
			{
				Logger.Error("SMSSender.Biz.CustomerRole - SelectAll", ex);
				throw;
			}

		}

	}
}
